﻿<UserControl x:Class="StockholmsStad.Windows.UI.Modules.Maintenance.Controls.SchedulerControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:DateControls="clr-namespace:Microsoft.Samples.KMoore.WPFSamples.DateControls;assembly=J832.Wpf.BagOTricksLib">
    <UserControl.Resources>
        <ControlTemplate x:Key="GeneratedTimeTemplate" TargetType="ListViewItem">
            <Border
		BorderThickness="{TemplateBinding Border.BorderThickness}"
		Padding="{TemplateBinding Control.Padding}"
		BorderBrush="{TemplateBinding Border.BorderBrush}"
		Background="{TemplateBinding Panel.Background}"
		SnapsToDevicePixels="True">
                <ContentPresenter
			Content="{TemplateBinding ContentControl.Content}"
			ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
			HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
			VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
			SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
            </Border>
        </ControlTemplate>
        <Style TargetType="ListViewItem">
            <Setter Property="Template" Value="{StaticResource GeneratedTimeTemplate}" />
        </Style>

        <DataTemplate x:Key="GeneratedTimeDataTemplate">
            <TextBlock>
                <CheckBox x:Name="checkbox" Content="{Binding}" 
                          IsChecked="{Binding	RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListViewItem}}, Path=IsSelected}" />
                <TextBlock Text="{Binding Time}" />
                <TextBlock Text="{Binding IsActive}" />
                <TextBlock Text="{Binding Minister}" />
            </TextBlock>
        </DataTemplate>
    </UserControl.Resources>
    
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        
        <GroupBox Grid.Column="0" Header="Generering" Margin="5,10,5,5">

            <StackPanel>

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Label Grid.Row="0" Grid.Column="0" Content="Startdatum:" Target="{Binding ElementName=datePicker}" />
                    <Label Grid.Row="1" Grid.Column="0" Content="Antal:" />
                    <Label Grid.Row="2" Grid.Column="0" Content="Starttid:" />
                    <Label Grid.Row="3" Grid.Column="0" Content="Sluttid:" />
                    <Label Grid.Row="4" Grid.Column="0" Content="Intervall:" />

                    <DateControls:DatePicker x:Name="datePicker" HorizontalAlignment="Center" VerticalAlignment="Top" Grid.Row="0" Grid.Column="1" />
                    
                    <ComboBox x:Name="cbNumberOfDates" Grid.Row="1" Grid.Column="1" Text="" HorizontalAlignment="Stretch" />
                    <TextBox x:Name="tbStartTime" Grid.Row="2" Grid.Column="1" Text="" HorizontalAlignment="Stretch" />
                    <TextBox x:Name="tbEndTime" Grid.Row="3" Grid.Column="1" Text="" HorizontalAlignment="Stretch" />
                    <TextBox x:Name="tbInterval" Grid.Row="4" Grid.Column="1" Text="" HorizontalAlignment="Stretch" />

                    <Button Grid.Row="6" Grid.ColumnSpan="2" Content="Generera" HorizontalAlignment="Right" />
                </Grid>

                <StackPanel Orientation="Vertical" Margin="0,5,0,0">
                    <Label Content="Förrättare:" />
                    <ComboBox HorizontalAlignment="Stretch" Margin="5,0,0,5" />
                    <Button Content="Tilldela" HorizontalAlignment="Right" />
                </StackPanel>
            </StackPanel>
        </GroupBox>

        <GroupBox Grid.Column="1" Header="Schemadagar" Margin="5,10,5,5">

        </GroupBox>


        <GroupBox Grid.Column="2" Header="Genererade schemadagar" Margin="5,10,5,5">

        </GroupBox>
    </Grid>
</UserControl>
